<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="utf-8" />
        <title>Tree - ESUI Demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="assets/google-code-prettify/prettify.css" />
        <link rel="stylesheet" href="assets/themes/standard.css" />
        <!--[if lt IE 9]>
        <link rel="stylesheet" href="assets/ie8.css" />
        <![endif]-->
    </head>
<body>
    <div class="header">
        <h1 id="branding">ESUI - Tree</h1>
    </div>
    <div class="ui-g main-container">
        <div id="side-bar" class="ui-u-1-5">
            <ul id="navigator" class="ui-nav">
            </ul>
        </div>
        <div id="main" class="ui-u-4-5">
            <h2>Tree</h2>
            <p>默认样式</p>
            <div class="example">
                <h3>小箭头</h3>
                <div id="container"></div>
                <h3>文件夹</h3>
                <div id="container2"></div>
                <h3>三角</h3>
                <div id="container3"></div>
                <h3>没有根节点</h3>
                <div id="container4"></div>
                <h3>checkbox</h3>
                <div id="container5"></div>
            </div>
            <script type="text/sample" data-refid="main-js">
            </script>
        </div>
    </div>
    <script src="assets/loader/esl.js"></script>
    <script src="config.js"></script>
    <script src="demo.js"></script>
    <script src="assets/google-code-prettify/prettify.js"></script>
    <script id="main-js">
        require(
            [
                'esui',
                'esui/Tree',
                'esui/TreeStrategy',
                'esui/Tab',
                'demo'
            ],
            function (esui, Tree, TreeStrategy) {
                esui.init();
                var datasource = {
                    id: '1',
                    text: '百度',
                    children:[
                        {
                            id: '2',
                            text: '联盟研发部',
                            children: [
                                { id: '21', text: 'RD' },
                                { id: '22', text: 'FE' },
                                { id: '23', text: 'QA' },
                                { id: '24', text: 'PM' }
                            ]
                        },
                        {
                            id: '3',
                            text: '贴吧事业部',
                            children: [
                                { id: '31', text: 'RD' },
                                { id: '32', text: 'FE' },
                                { id: '33', text: 'QA' },
                                { id: '34', text: 'PM' }
                            ]
                        },
                        {
                            id: '4',
                            text: '百度音乐'
                        }
                    ]
                };

                var tree = new Tree({ id: 'normal', datasource: datasource, strategy: new TreeStrategy(), wideToggleArea: true, variants: 'hoverable icon angle'});
                var tree2 = new Tree({ checkboxes: true, datasource: datasource, strategy: new TreeStrategy({ defaultExpand: true }), variants: 'icon folder', selectMode: 'multiple'});
                tree.appendTo(document.getElementById('container'));
                tree2.appendTo(document.getElementById('container2'));
                var tree3 = new Tree({ id: 'normal2', datasource: datasource, strategy: new TreeStrategy(), wideToggleArea: true, variants: 'icon caret' });
                tree3.appendTo(document.getElementById('container3'));
                var tree4 = new Tree({ hideRoot: true, datasource: datasource, strategy: new TreeStrategy(), wideToggleArea: true, variants: 'icon caret' });
                tree4.appendTo(document.getElementById('container4'));
                var tree5 = new Tree({ checkboxes: true, datasource: datasource, strategy: new TreeStrategy(), wideToggleArea: true, variants: 'icon caret' });
                tree5.appendTo(document.getElementById('container5'));
            }
        );
    </script>
    <script src="sitemap.js"></script>
</body>
</html>